home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 126-150 / scopedisk143 / vlt4.824 / docs / vlt4p824.doc < prev   
Text File  |  1995-03-19  |  67KB  |  1,547 lines

  1. +----------------------------------------------------------------------+
  2. |                                                                      |
  3. |                  D I S C L A I M E R   N O T I C E                   |
  4. |                                                                      |
  5. |  This document and/or  portions of the material and  data furnished  |
  6. |  herewith,  was developed under sponsorship of the U.S. Government.  |
  7. |  Neither the U.S.  nor  the U.S.D.O.E.,  nor  the  Leland  Stanford  |
  8. |  Junior University, nor their employees,  nor their respective con-  |
  9. |  tractors, subcontractors, or their employees, makes  any warranty,  |
  10. |  express or implied, or assumes any liability or responsibility for  |
  11. |  accuracy,  completeness or  usefulness of any information, appara-  |
  12. |  tus, product or process disclosed, or represents that its use will  |
  13. |  not infringe privately-owned rights.  Mention of any product,  its  |
  14. |  manufacturer, or suppliers shall not, nor is it intended to, imply  |
  15. |  approval, disapproval, or fitness for any particular use. The U.S.  |
  16. |  and  the University at all times  retain the right to use and dis-  |
  17. |  seminate same for any purpose whatsoever.                           |
  18. |                                                                      |
  19. +----------------------------------------------------------------------+
  20.  
  21. Tektronix is a trademark of Tektronix, Inc.
  22. VT100 is a trademark of Digital Equipment Corporation.
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                 VLT 4.824 Additional Documentation
  29.                 ==================================
  30.  
  31.                      (C) Copyright 1989, 1990
  32.  
  33.                                by
  34.  
  35.                         W.G.J. Langeveld
  36.  
  37.                 Stanford Linear Accelerator Center
  38.  
  39.  
  40.  
  41. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  42.         General
  43. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  44.  
  45.     The most important changes in VLT involve the scripting facility and
  46. ARexx support. The scripting facility has been completely rewritten. Not one
  47. line of the original code remains. The new features include:
  48.  
  49.     1) All commands are now available from ARexx,
  50.         2) One can extract all available information from ARexx (extract).
  51.     7) Any number of simultaneous scripts, ARexx's, function keys allowed.
  52.     3) All commands that used to be "init-only" can now be used at any time.
  53.     4) All commands that were not available during "init" now are.
  54.     5) The command set has been orthogonalized. No more "funny" names.
  55.     6) The "wait" command now has an optional timeout with report to ARexx.
  56.     8) One can now "trap" or "on" on any number of strings from the host.
  57.     9) One can now put multiple script commands on the same line.
  58.        10) Consequently, multiple script commands per function key definition.
  59.        11) And also, multiple script commands from any one ARexx call.
  60.        12) Errors now show an actual error message and the script line number.
  61.        13) Error messages are reported as error codes (RC) to ARexx.
  62.        14) And, the corresponding error message can be retrieved (fault).
  63.        15) All ARexx reports are handled using REXX variables interface (RVI).
  64.        16) Time values can now be specified as hh:mm:ss.ff
  65.        17) Scripts can have a name and may be cancelled by name.
  66.        18) A tracing facility is now added.
  67.        19) A wedge command allows intercepting and changing keystrokes
  68.        20) ...And more... 8^)
  69.  
  70.     The bad news is, that quite a few commands have been renamed or
  71. moved to subcommands of other commands. Therefore, people with existing
  72. scripts may have to do some rewriting. Further, there are no script
  73. commands for the Tektronix part yet, this will be remedied in the next
  74. release.
  75.  
  76.     The rest of this document is devided in several parts. First there is
  77. a section on the new features in VLT. Then there is an introduction to the
  78. new scripting facility with some examples. Then there is a short section 
  79. listing some conventions for the following section, which contains a list
  80. of all commands with short descriptions for each one. For some commands, a
  81. longer description is given Appendices A throgh D.
  82.  
  83.     A new manual is being worked on. 52 pages of fine print in TeX
  84. have been completed thusfar, but it will take a little more time before
  85. the manual is completed. Watch for an announcement on BIX. I will likely
  86. post a DVI file for those that have TeX, and I will try to make the manual
  87. a standard SLAC Technical Report so that people can request it directly
  88. from the SLAC publications department.
  89.  
  90.  
  91.     Willy Langeveld, 31 july 1990.
  92.  
  93.  
  94. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  95.         What's New In VLT?
  96. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  97.  
  98. 1. VT100 Section
  99. ----------------
  100.  
  101.     This section lists the changes in the VT100 section  of VLT in pretty
  102. much chronological order since version 4.428. No doubt the biggest changes are
  103. in the script facility and ARexx support. This is described in a separate
  104. section and will only briefly be mentioned here. A large number of small details
  105. have been fixed, cleaned up, or just changed. We will only list the ones you're
  106. likely to run into...
  107.     VLT now no longer has *any* restrictions on usage of commands in
  108. vlt.init or "+i" scripts (i.e. scripts started using the +i command line
  109. option). This allows one to write a script where VLT's main screen or window
  110. never opens at all. All commands can be used. Of course commands that involve
  111. the display aren't effective, and the text isn't stored in the review buffer,
  112. although you can of course capture the session. You can also close VLT's
  113. screens and windows using a script command. See scripts (clear command).
  114.     The built-in Kermit and XMODEM are no more. If you want to use Kermit or
  115. XMODEM, you will also need Steve Walton's xprkermit and Marc Boucher's
  116. xprxmodem. These two are in the Amiga listings areas on BIX. However, the menu
  117. items are still the same (pretty much) and "kermit" and "xmodem" are still valid
  118. options in scripts. The script command set has been changed, as is detailed in a
  119. separate section. XPR protocols now will use ARP style wildcards if the
  120. protocol supports wild cards.
  121.     The way VLT handles "non-wrapping" mode, i.e. the mode where characters
  122. are not wrapped to the next line when the line exceeds the maximum number of
  123. columns has been changed to conform to VT100 standard. This may show up in a
  124. funny way: if you type beyond the last column and then backspace using
  125. destructive backspace, you may wind up with a dangling character at the end of
  126. the line that cannot be erased. This is a feature, not a bug. A problem with
  127. "tabs" beyond the last column was also fixed.
  128.     A number of special private escape sequences are now absorbed (but not
  129. acted upon) that weren't before. Also, there was a possibility to  crash VLT
  130. given certain very specific "runnaway" escape sequences. The VT100 Device
  131. Control String (DCS) is now also properly absorbed (but not acted upon). The
  132. escape sequences to enable or disable key-repeat are now supported, and there is
  133. a new menu option to control key-repeat. A number of other VT100 emulation
  134. problems were fixed.
  135.     The Hangup command (script and menu) now only closes and opens the
  136. serial device once (it used to do so twice). This makes it more convenient to
  137. use with Syndesis' TSSNet.
  138.     VLT now uses a backdrop window for its main window when on a custom
  139. screen. This means that status windows and requesters can no longer disappear
  140. behind it, and allows DMouse style programs to "push VLT behind everything else"
  141. even if there are requesters or other windows still open.
  142.     There are two new command line options: -b starts VLT in "background"
  143. mode, i.e. it doesn't open screens or windows. +c <vlt-script-command(s)> allows
  144. one to start VLT off with one or more script commands straight from the  command
  145. line.
  146.     The escape sequence to allow VLT commands to be executed directly from
  147. the host now allows specification of the size of the command. Collection of this
  148. command from the host is now terminated when the buffer is full and/or when the
  149. "clear screen" menu option is invoked.
  150.     One can now save selected lines in the review buffer to the Amiga
  151. clipboard. Also, whenever selected lines are saved to a file or to the
  152. clipboard, the selected lines are now unselected. All known problems and quirks
  153. of the review buffer should now be fixed. This includes the cases where drag
  154. selecting lines would sometimes all of a sudden select everything; and sometimes
  155. Edit/Send would get things in the wrong order.
  156.     There is now a "raw" capture mode: all characters are saved, including
  157. returns and linefeeds, as they were sent by the host.  Non-raw capture does some
  158. basic translations assuming the capture file is a text file. See scripts.
  159.     Some menu items were renamed and moved. The "downcase" menu item was
  160. moved to the Kermit options menu, since it only affects Kermit transfers. The
  161. change directory menu item is now in the VLT menu, since it affects everything
  162. in VLT. The Program mode option is also in the VLT menu since there are number
  163. of different things that can be programmed. A Refresh Screen option was added
  164. and also a Remove All Traps option. The Change Directory menu item was moved
  165. from the Transfer menu to the VLT menu: it changes the programs default
  166. directory globally, not just the default for downloads. Some menu options are
  167. now properly disabled when running on the Workbench. A couple of menu items
  168. acquired some abbreviations. Note that "Exit" now has one, right-Amiga-shift-> .
  169. Too hard to type in accidentally, but made available by popular request. Open
  170. Console also has one now: right-Amiga single quote. Right-Amiga V, the shortcut
  171. for the Open Review Buffer Window menu item, will reactivate the review window
  172. if it was already open.
  173.     There is now a user menu with 10 programmable options: not only the
  174. function but also the text may be programmed. The way to do this is to add a
  175. comment at the end of the sequence to which the item is programmed. For example,
  176. if the item was programmed to be:
  177.              ~@dialbix.scp
  178. one might change it to:
  179.              ~@dialbix.scp    # Dial BIX
  180. The words   Dial BIX   will now appear in the menu. Note: if the sequence
  181. was just a bunch of text to be sent to the host, such as:
  182.              myusername*R
  183. then you can't just add the comment: VLT would send the comment too when
  184. this item was selected during normal operation. However, you could get the
  185. same effect by reprogramming it to:
  186.              ~send "myusername*R"     # Send myusername
  187. Conversely, if there is a command which has a pound sign in it such as:
  188.              ~emit "foo#bar"
  189. then you may wind up with the text    bar"  in the menu. This doesn't affect
  190. the operation, but is a little ugly and can be fixed by adding a real
  191. comment to the line:
  192.              ~emit "foo#bar"   # Some item text
  193. You get the picture...
  194.     The MESSAGE command now parses its argument for ARP sequences, so you
  195. can use the *N directive to go to a new line. There is a compatibility issue: if
  196. you used *'s before you are in trouble. Escape the * by a *, i.e. **. See 
  197. scripts.
  198.     It is now possible to start VLT from the Workbench and have it run a
  199. script. See the testscript.scp script and icon. Double click on testscript.scp's
  200. icon, and it should tell you a story. One can get VLT up running a sequence of
  201. scripts by shift-selecting them in the proper order and double-clicking on VLT's
  202. icon. VLT will change its default directory to the location where the icon was
  203. found before running each script.
  204.     There's a problem with clipboard support. It seems some programs don't
  205. run properly if a clip with an odd number of data bytes is padded in compliance
  206. with the IFF spec. I changed VLT to cooperate with these programs. However,
  207. there is a new script command, called MISCFLAGS, which allows you to change
  208. various things. The only thing supported now is bit 0: it means pad clips
  209. according IFF spec if you set it, i.e. MISCFLAGS 1 is the command you want. Once
  210. set, you can save the configuration and this setting will remain in effect.
  211. As mentioned, the default setting of MISCFLAGS is 0. See also scripts.
  212.  
  213.  
  214. A few one-liners:
  215. -----------------
  216. - A problem with VLT taking up a lot of cycles when the console window was
  217.   open was fixed.
  218. - In previous versions the text was only centered horizontally, according
  219.   to font size and window width. Now it is also centered vertically.
  220. - A number of changes were made to allow Graphics and VT100 text on the
  221.   same screen. See the Tektronix section for details.
  222. - A number of stylistic changes were made that are only apparent when
  223.   running VLT under AmigaDOS 2.0. See also scripts.
  224. - It is no longer possible to run into trouble with key-repeats when using
  225.   keyboard short-cuts for menu items.
  226. - The handling of the situation where a noise burst sends an Xoff to VLT
  227.   is greatly improved.
  228. - Mouse support now also reports left/right shift/alt/amiga/ctrl/
  229.   caps-lock status.
  230. - One can now program the primary and secondary Device Status Reports, see
  231.   "scripts".
  232. - There is a script option called "wedge". It allows one to intercept
  233.   and modify keystrokes. See scripts.
  234. - An attempt is now made to abort ARexx scripts that still have
  235.   outstanding commands scheduled within VLT.
  236. - ALT-keypresses now use the full deadkeyconvert logic, i.e. it
  237.   is now possible to generate accented characters using the Amiga standard
  238.   way of using the alt key.
  239. - "Snap"-like programs should now be able to work with VLT: VLT now
  240.   SetFonts the Window rastport in addition to its own copy.
  241. - The way colors are determined for various operations under 2.0 (like
  242.   shadow and shine for gadgets) is now programmable. See scripts.
  243.  
  244.  
  245. 2. Tektronix Section
  246. --------------------
  247.  
  248.     The Tektronix section has had only one major upgrade this time
  249. around, and a number of smaller changes. The big change is that one can now
  250. display graphics in the main VLT window, together with the VT100 text. One
  251. can even set things up so that the graphics and the text don't interfere, by
  252. setting proper color mappings and masks. To this end, a new color options
  253. requester was added, which allows one to set mappings for all colors and an
  254. "erase mask". When set to run on the main VLT window, and when all colors
  255. are set to map to 4, and also the erase mask is set to 4, and the options
  256. Mask  Colors and Lock Colors are selected, the Tektronix part of VLT will
  257. essentially only use the third bitplane of the main VLT screen, and when
  258. the user uses either Quick or Normal rendering for the VT100 display, the
  259. graphics will overlay the text without interference and can be separately
  260. controlled.
  261.     In previous versions one could only control horizontal and
  262. vertical scaling. One can now also control the X and Y offset of the
  263. graphics display.
  264.     There is a new menu option that allows one to specify whether the
  265. <esc> %! 1 sequence flips the screen back to VT100 or not. Also: some menu
  266. options are now properly disabled when running on the Workbench.
  267.     Also a number of bugs were fixed, the most bothersome of which
  268. may have been that Move and Draw didn't always update VLT's idea of where
  269. x and y were, causing sometimes text to be displayed all at the top.
  270. Another problem was that certain inquiries weren't recognized.
  271. A number of escape sequences that should only be recognized in alpha mode
  272. are now also recognized in vector mode to overcome some buggy mainframe
  273. software.
  274.  
  275.  
  276. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  277.         Introduction To New Scripting Facility
  278. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  279.  
  280. 1. Schedules
  281. ------------
  282.  
  283.     VLT's scripting facility is based on the notion of a "schedule".
  284. A schedule is a set of commands within their own context, with all information
  285. needed for the successful progress and completion of its operations. A schedule
  286. can be a regular VLT native script as in previous versions: in that case the
  287. context includes such things as a pointer to the script file, a list of labels
  288. that the script may contain, a number of string segments it is waiting for
  289. from the host, etc. Another example of a schedule is what is started when
  290. a programmable function key is pressed, if said key is programmed to execute
  291. one or more commands. And the final example of a schedule is when a line
  292. is received through VLT's ARexx port: such a line may contain one or more
  293. script commands. The context of an ARexx launched schedule would of course
  294. include the ARexx message that started it.
  295.     Schedules may have a name: VLT will assume that a schedule is named
  296. after its first label. So it may be a good idea to start all schedules
  297. (at least ones that have a chance to execute for a while) with a label
  298. that conveys some information about its purpose, even if there is never
  299. a "goto" to that label. A simple example would be:
  300.  
  301. #
  302. # This is the file blinker.scp
  303. #
  304. blinker:
  305.    cursorheight 0
  306.    delay 0.3
  307.    cursorheight 1
  308.    delay 0.3
  309.    goto blinker
  310.  
  311. As another example, run VLT (if you have ConMan 1.3) and open the console
  312. window. We can then start the same schedule by typing:
  313.  
  314.     ~blinker: cursorh 0; delay 0.3; cursorh 1; delay 0.3; goto blinker
  315.  
  316. The tilda (~) in front of the command is familiar from previous versions.
  317. It means: what follows is either a schedule or an @ sign followed by the
  318. name of a .scp or .vlt file. In this case, it is an in-line schedule, which
  319. is scheduled for execution. It has completely the same effect as selecting
  320. "VLT Script" from the menu and entering "blinker.scp" in the filename
  321. gadget (assuming the file blinker.scp above exists in your rexx: directory).
  322. The tilda, by the way, is not part of the scripting language itself. Just
  323. to complete the set of examples: the same schedule might have been started
  324. from outside VLT, say from WShell, by typing:
  325.  
  326.     1> "Address VLT 'blinker: curso .... oto blinker'
  327.  
  328. There is one side effect: the blinker will of course never complete, because
  329. it runs in an infinite loop. Therefore, the "address VLT"  will never return
  330. to WShell. This is why there is a "schedule" command: had we typed instead:
  331.  
  332.     1> "Address VLT schedule 'blinker: curso .... oto blinker'
  333.     1>
  334.  
  335. we would be returned immediately to the WShell command line, while the 
  336. blinker would blink merrily away.
  337.  
  338.  
  339. 2. Cancelling Schedules
  340. -----------------------
  341.  
  342.     Schedules can "expire" for a number of different reasons. For one
  343. thing, they may be cancelled by the user: when you select "Abort VLT Scripts"
  344. from the menu, all currently pending schedules are cancelled. From ARexx,
  345. you can use the Extract command to find among other things the currently
  346. pending named schedules, and use the "cancel" command to cancel a particular
  347. one or all of them. For example, from ARexx one might have typed:
  348.  
  349.     1> "Address VLT cancel blinker
  350.  
  351. to stop the blinker. By the way, if we followed the steps above, we would
  352. now be running *three* separate independent copies of the blinker, one
  353. from the script file, one we typed in from the console window and one or
  354. two we started from WShell using "address VLT". The "cancel blinker"
  355. command only aborted one of those three or four, the first one it found in
  356. the list of schedules. If we wanted to make sure that we only ever wanted
  357. to run *one* copy of the blinker, we could protect ouselves using a property
  358. of Cancel: the Cancel command only aborts *other* schedules, not the
  359. schedule that the cancel command is issued from. We could therefore modify,
  360. say, blinker.scp to read:
  361.  
  362. #
  363. # This is the file blinker.scp
  364. #
  365. cancel blinker
  366.  
  367. blinker:
  368.    cursorheight 0
  369.    delay 0.3
  370.    cursorheight 1
  371.    delay 0.2
  372.    goto blinker
  373.  
  374. and assuming this was the only way that blinker ever got started, any
  375. subsequent invocation would cancel the previous one.
  376.  
  377. 3. Timeouts, the Fault command, and timed Waits
  378. -----------------------------------------------
  379.  
  380.     Schedules can also expire when there are no more commands to
  381. be executed, or when an "exit" command is encountered. And finally,
  382. schedules expire whenever a fatal error is encountered. At this time,
  383. all errors are considered fatal, with one exception. The ARexx error
  384. code RC = 1 is reserved for the case where a timeout has occurred.
  385. To see this, type the following from WShell:
  386.  
  387.     1> "Address VLT; delay 1; say RC
  388.     1
  389.     1>
  390.  
  391. or, to demonstrate the Fault command:
  392.  
  393.     1> "Address VLT; delay 1; fault RC; say VLT.Error
  394.     Timeout
  395.     1>
  396.  
  397. Notice the colon after "address VLT" to indicate that all future commands
  398. are to go to VLT. While we're at it, we may as well explain what happened:
  399. first the command "delay 1" was sent to VLT. VLT ran a schedule with only
  400. that command in it. It timed out, and the ARexx standard error code RC was
  401. set to 1. Then the command "fault 1" was sent to VLT (since RC was 1), and
  402. VLT used the REXX variables interface to set the special VLT variable called
  403. VLT.Error to the message belonging to error 1, "Timeout". Of course, the
  404. Fault command does not depend on "RC": we might just have typed:
  405.  
  406.     1> "Address VLT; do i = 0 to 20; fault i; say VLT.Error; end;
  407.     Normal successfull completion
  408.     Timeout
  409.     ..............
  410.     ........
  411.     ......
  412.     1>
  413.  
  414. to see the full list of error messages VLT can return.
  415.     The reason that timeout is a special case, is seen in the following
  416. example. Suppose we want to wait for the host to send the string "Ready".
  417. Easy: just type
  418.  
  419.     1> "Address VLT wait 'Ready'
  420.  
  421. But suppose also that maybe the host might be broken and the word "Ready"
  422. might never appear. In that case we're up the creek, because WShell would
  423. just sit there, and nothing short of cancelling everything from the menu
  424. or from another script or ARexx command would cure it. Now suppose we
  425. expect that the command comes within the next three and a half seconds,
  426. and if it doesn't the host is surely kaputt. We can then use the timeout
  427. feature of Wait to do the following (an example ARexx program):
  428.  
  429.     /* simple.rexx program */
  430.     Address VLT
  431.  
  432.     wait "Ready" 3.5
  433.     if RC = 1 then do
  434.        say "Host must have croaked"
  435.        exit 20
  436.     end
  437.  
  438.     say "Okay, I guess we're ready"
  439.     exit 0
  440.  
  441. 4. Waits, Ons and Traps
  442. -----------------------
  443.  
  444.     In native scripts, there is no such thing as the RC variable: it
  445. is only defined within ARexx. To write the previous program in the native
  446. script language, we could do:
  447.  
  448.     #
  449.     #  Simple.scp script
  450.     #
  451.     simple:      # just a name
  452.  
  453.     wait (Ready) 3.5
  454.     emit [Don't know if we timed out or whether we received "Ready"]
  455.  
  456.     exit
  457.  
  458. but this is clearly not the way to go. Notice, that in the new script parser
  459. you no longer have to use single or double quotes to delimit strings: any
  460. form of brackets (<[{}]>) is also allowed. This allows us to easily nest
  461. quotes, and should especially help from ARexx.
  462.     To regain the functionality, we must use the On command:
  463.  
  464.     #
  465.     #  Simple.scp script
  466.     #
  467.     simple:
  468.  
  469.     on {Ready} goto gotit
  470.  
  471.     delay 3.5
  472.     emit <I guess we timed out: Host croaked.>
  473.     exit
  474.  
  475.     gotit:
  476.     emit 'Host is ready'
  477.     exit
  478.  
  479. Now suppose the host might either respond "Ready" or "I croaked". In that case
  480. it would be silly to have to delay 3.5 seconds. Instead we might use:
  481.  
  482.     ...
  483.     on "Ready" goto ready
  484.     on "croaked" goto croaked
  485.  
  486.     delay 3.5
  487.     emit "Limbo?"
  488.     exit
  489.  
  490.     ready:    emit "Host is ready"; exit
  491.     croaked:  emit "Host bought it"; exit
  492.  
  493.     There is no limit to the number of On's one might use. In practice,
  494. when the number of On's etc. approaches 10 or 20, things do tend to slow
  495. down a bit. Remember that each character has to be scanned for every On
  496. separately.
  497.     Okay, suppose we wanted to do the same trick in ARexx. We run into
  498. a problem: the program
  499.  
  500.     /* croaked.rexx the wrong way */
  501.     address VLT
  502.  
  503.     'on "Ready" goto ready'
  504.     'on "croaked" goto croaked'
  505.  
  506.     'delay 3.5'
  507.     say "Limbo?"
  508.     exit 20
  509.  
  510.     'ready:    emit "Host is ready"; exit'
  511.     'croaked:  emit "Host bought it"; exit'
  512.  
  513. obviously is totally bogus. The first On command is executed by VLT, and
  514. a trap is set for the string "Ready". VLT then looks for the next command,
  515. but *there is no next command*. For all VLT knows, it has received a
  516. schedule with only a single command. It can't look in the ARexx macro
  517. to see if there are any other ones, and neither does it know about labels
  518. defined in the ARexx macro. So it exits from this schedule, and cancels
  519. the trap for "Ready"! So the whole thing does nothing. In fact, the ARexx
  520. script will first wait 3.5 seconds, type "Limbo?" to the shell, and then
  521. emit "Host is ready" and "Host bought it" to the screen in rapid succession.
  522.     So obviously, "goto"s from On's are out, and with it labels.
  523. But we can do the following:
  524.  
  525.     /* croaked.rexx */
  526.     Address VLT
  527.  
  528.     port = OpenPort(MYPORT)
  529.  
  530.     'on "Ready"   rx [address MYPORT ready];   delay 10'
  531.     'on "croaked" rx [address MYPORT croaked]; delay 10'
  532.     'schedule (delay 3.5; rx [address MYPORT timeout])'
  533.  
  534. followed by a WaitPkt on MYPORT, and checking on whether READY, CROAKED
  535. or TIMEOUT show up. We notice, that we have added the delay 10 to the
  536. two On commands, to make sure they survive long enough. Since this is a
  537. little cumbersome, there is another command, called "trap" which allows
  538. a lot of flexibility. It is described in detail in one of the Appendices.
  539. One might rewrite the above schematically:
  540.  
  541.     ....
  542.     'trap add install "Ready"   (rx [address MYPORT ready])'
  543.     'trap add install "croaked" (rx [address MYPORT croaked])'
  544.     'schedule (delay 3.5; rx [address MYPORT timeout])'
  545.  
  546.     wait for messages
  547.  
  548.     'trap remove all'   /* to remove the two installed traps */
  549.  
  550.     All in all, there is a lot of flexibility built into the new
  551. trap system, there should really be no situations that are impossible
  552. to handle (you can have traps execute any number of commands).
  553.     Instead of the "schedule" command, we might also have used
  554.  
  555.     address ARexx "'call delay 175; address MYPORT timeout'"
  556.  
  557. by the way...
  558.  
  559. 5. Extract and Fault
  560. --------------------
  561.  
  562.     With Extract you can either extract a single item from VLT or
  563. all items at once. A sample of the use of Extract is given in one of
  564. the appendices: an ARexx program that extracts everything there is to
  565. know. Browse through the sample output, and you will find some remarkable
  566. things: all function keys, all program options, all outstanding
  567. schedules, etc. etc.
  568.     In particular, you can extract the line that is currently
  569. on the screen at the vertical location of the cursor, and also the
  570. current "search" line in the review buffer! Combine this with the
  571. new "movecursor" command, and you can read every line on the screen
  572. in an easy way from ARexx. Also extractable are the current x and y
  573. location of the cursor, and you can even put the cursor back to where
  574. it was. The stem variable that receives all the extracted values is
  575. always called VLT.
  576.     The Fault command uses the variable called VLT.Error, but we
  577. have already seen this command in action...
  578.  
  579.  
  580. 6. Command availability
  581. -----------------------
  582.  
  583.     All commands are available from ARexx. Two commands, Extract and
  584. Fault are *only* available from ARexx.
  585.     Further, all commands that used to be only allowed during initialization
  586. are now allowed at any time, including changing colors or screen resolution,
  587. etc.
  588.     Moreover, at init time, the serial port is now accessible,
  589. and any commands sending stuff to or waiting for stuff from the serial port
  590. will work fine. Note that the restrictions on "init" files, i.e. the default
  591. VLT.init file, or the file specified with the +i command line option, have
  592. now been removed. What it means is that any init script is just like any 
  593. other script, with one exception: during the init script, VLT's screen
  594. remains closed. Therefore, one can now write scripts that will never cause
  595. VLT's screen to open, and the simple init script containing the command
  596. "Pause" may now be used to run VLT as a server.
  597.     Since one can now run multiple scripts at the same time, using
  598. programmed function keys or sending ARexx commands while another script is
  599. executing is no longer a problem.
  600.  
  601. 7. I forgot...
  602. --------------
  603.  
  604.     I'm sure I forgot a lot of stuff. I guess, browse through the
  605. command list which follows and send me mail about stuff you don't
  606. understand.
  607.  
  608.     Willy.
  609.  
  610.  
  611. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  612.         Some conventions
  613. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  614.  
  615. Abbreviations:
  616.     The capitalized letters (unless indicated otherwise) indicate the
  617.     minimum number of characters that needs to be specified. Usually,
  618.     commands less than 6 characters in length need to be specified
  619.     fully, whereas with longer commands a suitable abbreviation of
  620.     3 or 4 characters or as many as needed to be unambiguous is used.
  621.  
  622. Appendices:
  623.     Some commands have rather lengthy explanations. For them, we refer
  624.     to several appendices.
  625.  
  626. Timeouts: hh:mm:ss.xx
  627.     Timeouts are specified in hours, minutes, seconds and hundredths of
  628.     seconds. Units not required need not be specified, i.e., the single
  629.     digit "1" means one second, whereas "1:00" means one minute, etc.
  630.  
  631. VLT Action Strings: {<string> | ~<command>}
  632.     A VLT action string is either a string that is sent to the host
  633.     after ARP style escapes are parsed, or it is a keyscript character
  634.     followed by one or more VLT script commands.
  635.  
  636. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  637.         The script commands
  638. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  639.  
  640. ACTivate {Vt100 | Tektronix | Next}
  641.     Bring either the VT100 screen, or the Tektronix screen, or the
  642.     next screen in the screen list to the front. If the VT100 
  643.         screen is not yet open, and Activate V or T is received, the
  644.     screen will now be opened.
  645.  
  646. ANSicolormode {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  647.     Switch ANSI color mode on or off. In ANSI color mode, color escape
  648.     sequences for foreground and background colors are recognized.
  649.  
  650. APPlicationcursor {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  651.     Switch Application Cursor mode on or off. In application cursor mode,
  652.     e.g. up arrow is transmitted as <esc> O A, otherwise as <esc> [ A.
  653.  
  654. AUToscreentoback {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  655.     Switch Automatic Screen-to-back mode on or off. When set, this option
  656.     causes the screen to be put behind all other screens when a protocol
  657.     transfer starts, with the status window appearing on the Workbench.
  658.     Otherwise, the status window remains on VLT's screen, and VLT's screen
  659.     remains where it is.
  660.  
  661. BAUD <baud rate>
  662.     Select a new transmission speed. Valid values are 110, 300, 1200,
  663.     2400, 4800, 9600 and 19200.
  664.  
  665. BEEP
  666.     Cause a beep. When a "Beep function" has been set, this function
  667.     is executed. Otherwise, when the volume is set to 0, the screen
  668.     will flash. If the volume is not zero, the built-in beep is
  669.     sounded.
  670.  
  671. BEEPFunction <beep function>
  672.     Set the command to be executed when the VLT bell should be sounded.
  673.     The command is a standard VLT action string. A common command is
  674.     ~rx "address 'PingServer' BEEP", which causes the BEEP command to
  675.     be sent to the "PingServer". See the documentation for the 'Ping'
  676.     program.
  677.  
  678. BREAK
  679.     Send a "break" to the host.
  680.  
  681. BREAKTime <break time>
  682.     Set the time (in microseconds) that the "break" signal lasts.
  683.     The default is 75000.
  684.  
  685. BUFfersize <size>
  686.     Sets the size of the serial buffer. the default is 2048 bytes, the
  687.     lower limit is 128, the upper limit is 32767 bytes.
  688.  
  689. CANcel {ALL | <script name>}
  690.     Cancels a specified script, or all scripts except the curent one
  691.     if "all" is specified. If a script needs to be run without 
  692.     interference from other scripts, a "cancel" may be placed as
  693.     the first command in a script.
  694.     Script names are determined by their first label. Therefore, it
  695.     is recommended to specify the name of the script in the form of
  696.     a label at the beginning of the script. When two scripts of the
  697.     same name are present, the first script found will be cancelled.
  698.  
  699. CAPture <file name>
  700.     Capture the session to a file with the specified file name.
  701. CAPture RAW {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  702.     Select the capture mode. With "raw" mode on, all characters are
  703.     captured as received, including carriage returns, line feeds and
  704.     nulls. Otherwise, nulls are stripped out, and files are stored
  705.     with linefeeds as line delimiters, according to Amiga standards.
  706. CAPture {SUSPEND | RESUME | FLUSH | OFF}
  707.     Suspend or resume capturing to the current capture file. "Flush"
  708.     causes the current buffer to be flushed to the capture file.
  709.     "Off" causes the current capture file to be closed.
  710.  
  711. CD <directory specification>
  712.     Change the current directory to the new directory specification.
  713.  
  714. CLEAR [CLOSE]
  715.     Clear the VT100 screen. If the CLOSE option is specified, the
  716.         screen or window will also be closed (See Activate).
  717.  
  718. COLOR <color number> <color value> [<pen-designation> [...]]
  719.     Set a certain color number to a particular RGB value. For example,
  720.     color 2 FFF sets color 2 to white. The three hexadecimal digits
  721.     specify R G and B respectively. Optionally, the specified color
  722.         may be assigned to any of the following 8 pens: DETail, BLOck
  723.         TEXt, SHIne, SHAdow, HIFILL, HIFILLText, BACkground. These assignments
  724.         only affect VLT when running with a custom Screen, and then only
  725.         when the screen has at four or more colors. When you make
  726.         these assignments, you must close VLT's screen and reopen it in
  727.         order to see the full effect. The Shine and Shadow assignments are
  728.         also used to determine shadowing of all gadgets VLT uses. Since        
  729.         these assignments are not protected in any way, it is up to the
  730.         user to be very careful: in certain situations system gadgets and
  731.         window borders may seem to disappear if certain pen assignments are
  732.         made. In order to get the same colors and settings that are in effect
  733.         on the Workbench, run the following script:
  734.         #
  735.         #  Set VLT's custom screen up for WB colors.
  736.         #
  737.         COLOR 0 AAA DETAIL BACKGROUND
  738.         COLOR 1 000 BLOCK TEXT SHADOW HIFILLTEXT
  739.         COLOR 2 FFF SHINE
  740.         COLOR 3 57A HIFILL
  741.         CLEAR CLOSE
  742.         ACTIVATE VT
  743.     To get pretty good looking shadowing on VLT's screen using VLT's
  744.     default colors, use
  745.         #
  746.         #  Set VLT's custom screen up for default 8 colors.
  747.         #
  748.         COLOR 0 000 DETAIL BACKGROUND HIFILLTEXT
  749.         COLOR 1 078 BLOCK TEXT
  750.         COLOR 2 A00 HIFILL
  751.         COLOR 3 090 
  752.         COLOR 4 C6A 
  753.         COLOR 5 E90 
  754.         COLOR 6 056 SHADOW
  755.         COLOR 7 999 SHINE
  756.         CLEAR CLOSE
  757.         ACTIVATE VT
  758.     As it turns out, these settings also work pretty well in 4 colors,
  759.     although the shine pen now effectively will be color 3, and the 
  760.     shadow pen color 2. As said before, for a two-color screen these
  761.     settings have no effect.
  762.  
  763. COLUmns <number of columns>
  764.     Sets the number of columns to be displayed on the screen. If the
  765.     number is larger than the number that fits on the current screen
  766.     size, the font may be changed to a smaller size.
  767.  
  768. CONTinue
  769.     Continue a script that is currently in a "pause", "delay", or "wait"
  770.     state. Execution is resumed at the command following the one that
  771.     caused either of these states.
  772.  
  773. CONSolewindowadjust {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  774.     When set, this option causes the number of lines displayed on the
  775.     screen to be adjusted to free up an area at the bottom of the screen
  776.     in order to display the console window, whenever that window is 
  777.     opened. When not set, the console window is opened without adjusting
  778.     the display.
  779.  
  780. CURsorheight <height>
  781.     Specifies the height of the cursor. If the number is identical to
  782.     the height of the current font, the cursor height will adapt to any
  783.     font changes.
  784.  
  785. CUStomscreen {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  786.     When set, opens VLT on its own custom screen. When not set, VLT opens
  787.     on the Workbench.
  788.  
  789. DELAY <timeout>
  790.     Causes the script to pause for the specified amount of time.
  791.  
  792. DESTructivebackspace {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  793.     When set, the backspace key causes the previous character to be
  794.     erased while the cursor moves to that location.
  795.  
  796. DSR <number> <device status report string>
  797.     Set the primary (number = 1) or secondary (number = 2) device status
  798.     report string. The string is a standard VLT action string.
  799.  
  800. ECHO {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  801.     Switch "echo" on or off.
  802.  
  803. ECHOLinefeeds {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  804.     When set, this option causes linefeeds to be echoed to the screen
  805.     as well as carriage returns, when the return key is pressed in local
  806.     echo mode.
  807.  
  808. EMIT [RAW] <character string>
  809.     Display a character string on the screen at the current cursor
  810.     position. If the "raw" option is specified, the string is not
  811.     parsed for ARP style escape sequences, otherwise it is.
  812.  
  813. EXIT [{VLT | QUiet [<next script>]}]
  814.     Exit the current script, or quit out of VLT entirely if VLT is
  815.     specified. When exiting a script, a message is displayed to indicate
  816.         that the script has terminated, unless the he quiet option is
  817.     specified. If a "next script" is specified, that script will next
  818.     be executed.
  819.  
  820. EXTRact [<field name>]
  821.     ARexx only. Extracts information from VLT in the form of the
  822.     VLT. stem variable. If no field is specified, all fields
  823.     are extracted. See Appendix A for an ARexx script that 
  824.     extracts all available fields.
  825.  
  826. FAULT <error number>
  827.     ARexx only: sets the variable "VLTError" to a text representation
  828.     of the error number specified. All VLT commands set the RC variable
  829.     in an ARexx script to a code depending on whether the command was
  830.     successful or not. One may call the "Fault" command with RC as an
  831.     argument to find out what the error code meant.
  832.  
  833. FILE {SENd | RECeive | GET} <file name>
  834.     Send or receive the file with specified file name to or from the
  835.     host using the currently active transfer protocol.
  836.  
  837. Function <key number> <command>
  838.     Set function key indicated by key number to a command. Key numbers are
  839.     in the range 1 to 80, where 
  840.      1 - 10 are the regular unshifted function keys;
  841.     11 - 20 are the shifted function keys;
  842.     21 - 30 are the ctrl-ed function keys;
  843.     31 - 40 are the alt-ed function keys;
  844.     41 - 50 are the menu items right-Amiga 1 through 0;
  845.     51 - 80 are the screen gadgets.
  846.     The command takes the usual form of a "VLT-action-string".
  847.  
  848. GOTO <label-name>
  849.     Go to specified label. The label name should be specified without the
  850.     trailing colon.
  851.  
  852. GRAphicslock {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  853.     Switch graphics lock on or off. When on, special characters from the
  854.     host will not be able to switch the mode to graphics. Otherwise,
  855.     certain control characters and escape sequences can change VLT's
  856.     mode to the graphics mode.
  857.  
  858. HANDshake {None | Xon/xoff | 7-wire}  [{Xon/xoff | 7-wire}]
  859.     Specify the handshake mode for the serial port. In case both xon/xoff
  860.     and 7-wire is desired, both options may be specified.
  861.  
  862. HANGup
  863.     Cause a "hangup". This is accomplished by dropping the DTR signal
  864.     on the serial port for a period of 1 second. Notice, that most 
  865.     modems can be set to ignore the DTR status, and that three-wire
  866.     cables do not usually convey this signal to the modem. If this
  867.     option does not work, you may have to send a special command
  868.     sequence to your modem, such as "+++" followed by a delay and "ATH"
  869.     in the case of Hayes compatible modems.
  870.     
  871. HELpkeylf {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  872.     When set, the help key transmits the "line feed" character (ctrl-J)
  873.     to the host. Otherwise, the help key transmits the sequence
  874.     <esc> O l (lower case L) when in application keypad mode.
  875.  
  876. INTerlace {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  877.     Switch interlace on or off, for custom screens.
  878.  
  879. KERmit BYE
  880.     Send a "Bye" message to host, if Kermit protocol is currently selected.
  881. KERmit DOWncase {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  882.     Causes file names of received files to be converted to lower case
  883.     when set.
  884. KERmit PACKetsize <packet size>
  885.     Sets maximum packet size to be used for Kermit transfers.
  886. KERmit MODE {Host_server | Send_receive}
  887.     Selects Kermit transfer mode between "host is server" or regular
  888.     send/receive.
  889.     
  890. KEYRepeat {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  891.     Switch key repeat mode on or off. When set, any key pressed and
  892.     held will send characters repeatedly. When not set, keys will never
  893.     repeat.
  894.  
  895. KEYScriptcharacter <ASCII character number>
  896.     Set the keyscript character. By default, this is the ANSI character
  897.     tilda, ~, ASCII number 126. Since many scripts assume this character
  898.     to be a tilda, it is usually unwise to change it.
  899.  
  900. LINES <number of lines>
  901.     Change the number of lines to be displayed on the screen to the
  902.     number indicated. If necessary/possible, the font will be changed
  903.     to a smaller or larger size.
  904.  
  905. LOCAL {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  906.     Switch VLT's local mode on or off. When in local mode, keys pressed
  907.     on the keyboard will not result in characters sent to the host.
  908.     Other means of sending characters to the host are not affected
  909.     (I.e. text entered through the console window or using script
  910.     commands etc.).
  911.  
  912. MESsage [<message>]
  913.     Post a message using VLT's message window. The '\' character may be
  914.     used to cause line feeds. When the <message> is not specified, the
  915.         current message window is closed.
  916.  
  917. MIScflags <flags>
  918.     Set various VLT options that didn't get a command all by themselves.
  919.     The only flag supported currently is bit 0: it sets the VLT review
  920.     buffer up to pad odd-length clips in compliance with the IFF spec,
  921.     but this disagrees with some editors, so the option is by default
  922.     off.
  923.  
  924. MOUsesupport {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE} [<mouse format>]
  925.     When on, the current mouse format will be used to create a VLT
  926.     action string which is subsequently executed whenever the
  927.     left mouse button is pressed on an active area of the screen. If
  928.     the mouse format is specified, that format will supersede the
  929.     old mouse format. When the mouse format is an empty string,
  930.     and mouse support is on, then a number of arrow sequences is sent
  931.     in order to position the cursor in the proper location.
  932.     The mouse format string is described elsewhere.
  933.  
  934. MOVecursor <x> <y>
  935.     Move the location of the cursor to (x, y). (1, 1) is the upper
  936.     left-hand corner. The maximum values are determined by the
  937.     displayed number of lines and columns. Notice, that this command
  938.     does not notify the host of the new cursor location.
  939.  
  940. NUMerickeypad {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  941.     Switch numeric keypad mode on or off. When set, the keypad transmits
  942.     the characters as displayed on the key caps. Otherwise, the keypad
  943.     transmits standard VT100 escape sequences.
  944.  
  945. ON <character string> <command>
  946.     Wait until the specified character string is received and then perform
  947.     the specified command. Only a single command may be specified. "On"
  948.     traps are in force until the context they belong to expires, or until
  949.     one is specified with the same character string. If the command
  950.         specified then is an empty string, the trap will be removed.
  951.  
  952. PARity <parity specification>
  953.     Select the parity to be used for serial port communications. Valid
  954.     values are given by a sequence of three characters: the number of
  955.     data bits (7 or 8), the parity mode (N, M, S, E or O), and the number
  956.     of stop bits (1 or 2), e.g. 7E1 or 8N1. Alternatively, the
  957.     following shortcuts may be used: none (8N1), mark (7M1), space (7S1),
  958.     even (7E1) or odd (7O1).
  959.  
  960. PAUse
  961.     Halt execution at this point in the script and wait for a "continue".
  962.  
  963. PRELoadgraphics {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  964.     When set, causes VLT to open the graphics screen on startup. When
  965.     not set, VLT only opens the graphics screen when needed.
  966.  
  967. PREScroll <number of lines>
  968.     Sets the maximum number of lines to be prescrolled. If the currently
  969.     available data indicates that the screen needs to be scrolled a
  970.     number of times, all scrolls up to the maximum number set with this
  971.     command will be performed at once. This increases scrolling speed.
  972.  
  973. PROGrammode {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  974.     Switch program mode on or off.
  975.  
  976. REFresh
  977.     Refresh the text on the screen. Sometimes useful when running
  978.         on the Workbench screen.
  979.  
  980. RENdermode {Quick | Color | Normal}
  981.     Set the rendering mode. "Quick" means that all text will be rendered
  982.     in monochrome mode, but very quickly, whereas "color" means that 
  983.     all text attributes will be converted to different colors, and also
  984.     ANSI color sequences are recognized to an extent. See also
  985.     "ansicolormode". In "Normal" mode, bold text will be displayed in
  986.     a different color, but all VT100 text attributes are displayed as
  987.     intended.
  988.  
  989. REView <review command> [<argument>]
  990.     Execute a review buffer command. The options  are described in the
  991.     table below. All commands consist of a single character, and some
  992.     of them allow an argument. There may be white space between the
  993.     command and the argument but there doesn't have to be. The allowed
  994.     commands and arguments are shown in the table in appendix B.
  995.  
  996. REXxportname <name>
  997.     Change the name of VLT's ARexx port to the specified name. This command
  998.     can only be used if no outstanding ARexx scripts are around.
  999.  
  1000. RX [SYNChronous] <ARexx command>
  1001.     Submit the specified ARexx command to ARexx. If the synchronous option
  1002.     is specified, the command is executed synchronously: the program will
  1003.     wait until the ARexx command has completed before continuing.
  1004.  
  1005. SCHedule <commands>
  1006.     Creates a new context and starts executing the specified commands
  1007.     in that context. Multiple commands need to be separated by semicolons.
  1008.  
  1009. SCREENDepth <depth>
  1010.     Set the depth of the screen. Values from 1 to 3 are allowed.
  1011.  
  1012. SCREENGadgets  {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1013.     Switch screen gadgets on or off. When on, the standard screen displays
  1014.     30 gadgets at the bottom, all of which are programmable. The display
  1015.     will be adjusted to fit the set number of lines in the remaining area.
  1016.  
  1017. SEND [RAW] <character string>
  1018.     Send a string of characters to the host. If "raw" is specified as
  1019.     an option, the string is not parsed for ARP style escape sequences,
  1020.         but by default it is.
  1021.  
  1022. SENDLinefeeds {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1023.     When set, this option causes linefeeds to be transmitted in addition
  1024.     to carriage returns, whenever the return key is pressed.
  1025.  
  1026. SERialdevice <device> [<unit>]
  1027.     Select a different serial device to be used. Optionally, select the
  1028.     unit number to be used. If the unit number is not specified, the
  1029.     previous unit number is assumed.
  1030.  
  1031. SHIfttabesctab {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1032.     When set, the TAB key transmits <esc> <tab> to the host when the
  1033.     shift key is pressed at the same time. Some hosts interpret this
  1034.     sequence as "back tab". When not set, the shifted TAB key transmits
  1035.     just <tab>.
  1036.  
  1037. STRipbit8 {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1038.     Switch stripping of the high-order bit of data coming in through the
  1039.     serial port on or off. This is only useful with parity settings that
  1040.     have 8 data bits.
  1041.  
  1042. SWApbackspacedelete {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1043.     When set, this option swaps the functions of the backspace and delete
  1044.     keys. This option is useful to VAX users.
  1045.  
  1046. TRACE <flags> <command-delay>
  1047.     When <flags> is set to a non-zero value, certain tracing options
  1048.     are switched on. When <command-delay> is non-zero, a delay is 
  1049.     inserted after each line of trace output. The delay is in ticks,
  1050.     i.e. 50 ticks is one second. The flags variable consists of a mask:
  1051.     bit 0 enables tracing of every line in the script, bit 1 enables
  1052.         tracing of all "traps" (i.e. On's, Wait's and Trap's). Also, little
  1053.     tick marks are displayed on the screen at or near the words that
  1054.     caused the trap. Bit 2 causes the output to be displayed in VLT's
  1055.         Console window (if it is open) and bit 3 causes the output to be
  1056.         appended to the file VLT.log in    the current default directory.
  1057.         The file is closed after each addition, so that in case of crash
  1058.         the file most often is preserved. Example: trace 15 20 causes both
  1059.         script line tracing, trap tracing, and the output is sent to both
  1060.         the console (if it is open) and to the log file. there will be a
  1061.         .4 second delay after each script line and each trap line. Note:
  1062.     if you suspect that a particular script may cause a crash, be
  1063.     warned that logging to VLT.log may be hazardous to your hard disk.
  1064.     Better set your default to rad:, and use DiskSalv to recover the
  1065.     file from rad: if rad: doesn't recover by itself.
  1066.  
  1067. TRANsfer Mode {image | text}
  1068.     Select image or text mode for file transfers. In text mode, files
  1069.     are assumed to be text files, and end-of-line sequences are converted.
  1070.     Also, ctrl-Z's in the file may be used as an end-of-file indication.
  1071. TRANsfer Protocol {External | Kermit | Xmodem}
  1072.     Select the transfer protocol: one of Kermit, XMODEM or External. In
  1073.     case of external protocols, use XPR select to determine which external
  1074.     protocol is to be used.
  1075.  
  1076. TRAP <trap-operation>
  1077.     This command is discussed in detail in Appendix C.
  1078.  
  1079. VOLume <volume>
  1080.     Sets the volume of the BEEP to be used. When zero, the screen is
  1081.     flashed instead. When positive, the usual VT100 beep is sounded.
  1082.     when negative, a higher-pitched shorter beep is used. This is
  1083.     however superseded by any Beepfunction, see there.
  1084.  
  1085. WAIT <character string> [<timeout>]
  1086.     Wait until the specified character string is received from the host,
  1087.     or, if specified, until the timeout period has expired. If this is
  1088.     the last command before returning to a REXX process, the return
  1089.     code will reflect that a timeout ocurred. "Wait" traps with timeout
  1090.     are equivalent to "On <character string> continue; delay <timeout>;"
  1091.     except that contrary to "On" traps, the "Wait" trap is only valid
  1092.     for one occurrence. The character string is parsed for ARP style
  1093.     escape sequences.
  1094.  
  1095. WEDGE <item> <port name>
  1096.     Currently only one item can be wedged: KEYStrokes.
  1097.     If the specified port name exists, a REXX message will be sent to that
  1098.         port of the form:   KEYSTROKE <code> <qualifier> <character>
  1099.     where the code and qualifier numbers are the key code and lowest
  1100.         order 8 qualifier bits of the key pressed by the user. The "character"
  1101.         is the translation of code and qual using the current default keymap.
  1102.         If no translation is available, this field will be absent. Note, that
  1103.         the special case where the space bar was pressed will look the same.
  1104.         For an example of the use of this function see the appendix D.
  1105.  
  1106. WORkbenchcolors {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1107.     When set, uses the Workbench colors rather than the saved custom
  1108.     screen colors.
  1109.  
  1110. WRAP {{ON | YES | 1} | {OFF | NO | 0} | TOGGLE}
  1111.     Switch wrapping of long lines on or off. When set, lines are broken
  1112.     at the current maximum column number and the remainder is displayed
  1113.     on the next line. When off, lines are not wrapped, and the cursor
  1114.     remains at the maxmum column accesible while overwriting the last
  1115.     character with all following characters according to VT100 standard.
  1116.  
  1117. XMOdemmode {1K | 128 | CHecksum | CRc} [{1K | 128 | CHecksum | CRc}]
  1118.     Set up to two XMODEM options. Options not specified will be
  1119.     carried over from the previous setting.
  1120.  
  1121. XPR INIT <init string>
  1122.     If the current protocol is external, then the specified initialization
  1123.     string is sent to the protocol. See the documentation of the protocol
  1124.     for documentation.
  1125. XPR SELect <external protocol>
  1126.     Select a different external protocol. Notice, that this command does
  1127.     not set the current transfer protocol - see "transferprotocol".
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1134.         Appendix A: The extract command
  1135. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1136.  
  1137.     The following ARexx script extracts all fields from VLT.
  1138. A sample list of output is shown below.
  1139.  
  1140. /**
  1141. *
  1142. *   Extract all fields from VLT
  1143. *
  1144. **/
  1145. address VLT
  1146. 'extract'
  1147. /*
  1148. *   Loop over all the fields
  1149. */
  1150. do i = 1 to VLT.fields
  1151.    a = VLT.fields.i
  1152. /*
  1153. *   Handle all fields with subfields in a special way
  1154. */
  1155.    if   a = "COLOR" then do
  1156.       do j = 0 to VLT.color - 1
  1157.          a = VLT.fields.i"."j
  1158.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1159.       end
  1160.    end
  1161.    else if a = "FIELDS" then do
  1162.       say overlay(a, copies(" ", 30)) " = this list"
  1163.    end
  1164.    else if a = "FUNCTIONKEY" then do
  1165.       do j = 1 to VLT.functionkey
  1166.          a = VLT.fields.i"."j
  1167.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1168.       end
  1169.    end
  1170.    else if a = "FUNCTIONKEYALT" then do
  1171.       do j = 1 to VLT.functionkeyalt
  1172.          a = VLT.fields.i"."j
  1173.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1174.       end
  1175.    end
  1176.    else if a = "FUNCTIONKEYCTRL" then do
  1177.       do j = 1 to VLT.functionkeyctrl
  1178.          a = VLT.fields.i"."j
  1179.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1180.       end
  1181.    end
  1182.    else if a = "FUNCTIONKEYSHIFT" then do
  1183.       do j = 1 to VLT.functionkeyshift
  1184.          a = VLT.fields.i"."j
  1185.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1186.       end
  1187.    end
  1188.    else if a = "FUNCTIONSCREENGADGET" then do
  1189.       do j = 1 to VLT.functionscreengadget
  1190.          a = VLT.fields.i"."j
  1191.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1192.       end
  1193.    end
  1194.    else if a = "FUNCTIONUSERMENU" then do
  1195.       do j = 1 to VLT.functionusermenu
  1196.          a = VLT.fields.i"."j
  1197.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1198.       end
  1199.    end
  1200.    else if a = "SCHEDULESPENDING" then do
  1201.       do j = 1 to VLT.schedulespending
  1202.          a = VLT.fields.i"."j
  1203.          say overlay(a, copies(" ", 30)) " = " VLT.a
  1204.       end
  1205.    end
  1206. /*
  1207. *   All other fields
  1208. */
  1209.    else do
  1210.       say overlay(a, copies(" ", 30)) " = " VLT.a
  1211.    end
  1212. end
  1213.  
  1214. ------------------ output: --------->
  1215.  
  1216. ANSICOLORMODE                   =  0
  1217. APPLICATIONCURSOR               =  0
  1218. AUTOSCREENTOBACK                =  0
  1219. BAUD                            =      9600
  1220. BEEPFUNCTION                    =  ~rx "address 'PingServer' beep"
  1221. BREAKTIME                       =  75000
  1222. BUFFERSIZE                      =  2048
  1223. CAPTUREFILE                     =
  1224. CAPTUREMODE                     =  0
  1225. COLOR.0                         =  0
  1226. COLOR.1                         =  cd
  1227. COLOR.2                         =  fb8
  1228. COLOR.3                         =  9f9
  1229. COLOR.4                         =  fad
  1230. COLOR.5                         =  ee0
  1231. COLOR.6                         =  77
  1232. COLOR.7                         =  fff
  1233. COLUMNS                         =  80
  1234. CONSOLEWINDOWADJUST             =  1
  1235. CURRENTDIR                      =  
  1236. CURRENTXPR                      =  libs:xprascii.library
  1237. CURSORFORMAT                    =  
  1238. CURSORHEIGHT                    =  0
  1239. CUSTOMSCREEN                    =  1
  1240. DESTRUCTIVEBACKSPACE            =  0
  1241. DSR1                            =  *e[?62;1;2;6;7;8c
  1242. DSR2                            =  *E[>1;10;0c
  1243. ECHO                            =  0
  1244. ECHOLINEFEEDS                   =  0
  1245. EMULATIONMODE                   =  129
  1246. FIELDS                          = this list
  1247. FUNCTIONKEY.1                   =  *EOP
  1248. FUNCTIONKEY.2                   =  *EOQ
  1249. FUNCTIONKEY.3                   =  *EOR
  1250. FUNCTIONKEY.4                   =  *EOS
  1251. FUNCTIONKEY.5                   =  f5
  1252. FUNCTIONKEY.6                   =  f6
  1253. FUNCTIONKEY.7                   =  f7
  1254. FUNCTIONKEY.8                   =  f8
  1255. FUNCTIONKEY.9                   =  f9
  1256. FUNCTIONKEY.10                  =  ~RX "address command 'tools:WLens 150 100 VLT'"
  1257. FUNCTIONKEYALT.1                =  a1
  1258. FUNCTIONKEYALT.2                =  a2
  1259. FUNCTIONKEYALT.3                =  a3
  1260. FUNCTIONKEYALT.4                =  a4
  1261. FUNCTIONKEYALT.5                =  a5
  1262. FUNCTIONKEYALT.6                =  a6
  1263. FUNCTIONKEYALT.7                =  a7
  1264. FUNCTIONKEYALT.8                =  a8
  1265. FUNCTIONKEYALT.9                =  a9
  1266. FUNCTIONKEYALT.10               =  a10
  1267. FUNCTIONKEYCTRL.1               =  c1
  1268. FUNCTIONKEYCTRL.2               =  c2
  1269. FUNCTIONKEYCTRL.3               =  c3
  1270. FUNCTIONKEYCTRL.4               =  c4
  1271. FUNCTIONKEYCTRL.5               =  c5
  1272. FUNCTIONKEYCTRL.6               =  c6
  1273. FUNCTIONKEYCTRL.7               =  c7
  1274. FUNCTIONKEYCTRL.8               =  c8
  1275. FUNCTIONKEYCTRL.9               =  c9
  1276. FUNCTIONKEYCTRL.10              =  c10
  1277. FUNCTIONKEYSHIFT.1              =  F1
  1278. FUNCTIONKEYSHIFT.2              =  F2
  1279. FUNCTIONKEYSHIFT.3              =  F3
  1280. FUNCTIONKEYSHIFT.4              =  F4
  1281. FUNCTIONKEYSHIFT.5              =  F5
  1282. FUNCTIONKEYSHIFT.6              =  F6
  1283. FUNCTIONKEYSHIFT.7              =  F7
  1284. FUNCTIONKEYSHIFT.8              =  F8
  1285. FUNCTIONKEYSHIFT.9              =  F9
  1286. FUNCTIONKEYSHIFT.10             =  F10
  1287. FUNCTIONSCREENGADGET.1          =  *EOP
  1288. FUNCTIONSCREENGADGET.2          =  *EOQ
  1289. FUNCTIONSCREENGADGET.3          =  *EOR
  1290. FUNCTIONSCREENGADGET.4          =  *EOw
  1291. FUNCTIONSCREENGADGET.5          =  *EOx
  1292. FUNCTIONSCREENGADGET.6          =  *EOy
  1293. FUNCTIONSCREENGADGET.7          =  *EOt
  1294. FUNCTIONSCREENGADGET.8          =  *EOu
  1295. FUNCTIONSCREENGADGET.9          =  *EOv
  1296. FUNCTIONSCREENGADGET.10         =  *EOq
  1297. FUNCTIONSCREENGADGET.11         =  *EOr
  1298. FUNCTIONSCREENGADGET.12         =  *EOs
  1299. FUNCTIONSCREENGADGET.13         =  *E!
  1300. FUNCTIONSCREENGADGET.14         =  *E@
  1301. FUNCTIONSCREENGADGET.15         =  *E#
  1302. FUNCTIONSCREENGADGET.16         =  *E$
  1303. FUNCTIONSCREENGADGET.17         =  *E%
  1304. FUNCTIONSCREENGADGET.18         =  *E^
  1305. FUNCTIONSCREENGADGET.19         =  *E&
  1306. FUNCTIONSCREENGADGET.20         =  *E**
  1307. FUNCTIONSCREENGADGET.21         =  *E(
  1308. FUNCTIONSCREENGADGET.22         =  *E)
  1309. FUNCTIONSCREENGADGET.23         =  *E_
  1310. FUNCTIONSCREENGADGET.24         =  *E+
  1311. FUNCTIONSCREENGADGET.25         =  *EOS
  1312. FUNCTIONSCREENGADGET.26         =  *E*X7F
  1313. FUNCTIONSCREENGADGET.27         =  *EOn
  1314. FUNCTIONSCREENGADGET.28         =  *EOl
  1315. FUNCTIONSCREENGADGET.29         =  *R
  1316. FUNCTIONSCREENGADGET.30         =  *EOM
  1317. FUNCTIONUSERMENU.1              =  ~@rexx:dialbix.scp
  1318. FUNCTIONUSERMENU.2              =  ~@rexx:dialslac.scp
  1319. FUNCTIONUSERMENU.3              =  ~@rexx:break.scp
  1320. FUNCTIONUSERMENU.4              =  m4
  1321. FUNCTIONUSERMENU.5              =  m5
  1322. FUNCTIONUSERMENU.6              =  m6
  1323. FUNCTIONUSERMENU.7              =  hea sk to last*R*R
  1324. FUNCTIONUSERMENU.8              =  m8
  1325. FUNCTIONUSERMENU.9              =  *X01$ GF4
  1326. FUNCTIONUSERMENU.10             =  ~exit VLT
  1327. GRAPHICSLOCK                    =  0
  1328. HANDSHAKE                       =     Xon/Xoff
  1329. HELPKEYLF                       =  1
  1330. INTERLACE                       =  1
  1331. KERMITDOWNCASE                  =  1
  1332. KERMITMODE                      =  send_receive
  1333. KERMITPACKETSIZE                =  1024
  1334. KEYREPEAT                       =  1
  1335. KEYSCRIPTCHARACTER              =  126
  1336. LINES                           =  32
  1337. MISCFLAGS                       =  0
  1338. MOUSESUPPORT                    =  0
  1339. NUMERICKEYPAD                   =  1
  1340. PARITY                          =     8N1
  1341. PRELOADGRAPHICS                 =  0
  1342. PRESCROLL                       =  8
  1343. PROGRAMMODE                     =  0
  1344. RENDERMODE                      =  normal
  1345. REVIEWBUFFERSIZE                =  32000
  1346. REVIEWLINEATCURSOR              =  
  1347. REVIEWSEARCHLINE                =  
  1348. REXXPORTNAME                    =  VLT
  1349. SCHEDULESPENDING.1              =  blinker:
  1350. SCREENDEPTH                     =  3
  1351. SCREENGADGETS                   =  0
  1352. SENDLINEFEEDS                   =  0
  1353. SERIALDEVICE                    =  devs:serial.device
  1354. SERIALUNIT                      =  0
  1355. SHIFTTABESCTAB                  =  1
  1356. STRIPBIT8                       =  1
  1357. SWAPBACKSPACEDELETE             =  0
  1358. TRANSFERMODE                    =  image
  1359. TRANSFERPROTOCOL                =  kermit
  1360. TRAPSPENDING                    =  0
  1361. VERSION                         =  VLT Version V4.677
  1362. VOLUME                          =  0
  1363. WORKBENCHCOLORS                 =  0
  1364. WRAP                            =  0
  1365. X                               =  1
  1366. XMODEMMODE                      =  1C
  1367. Y                               =  31
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1374.         Appendix B: The review command
  1375. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1376.  
  1377. Command: | Argument:      | Meaning:
  1378. ---------+----------------+--------------------------------------------------
  1379.          |                |
  1380.     A    | <filename>     | Save selected lines to <filename>.
  1381.     B    | <size>         | Set buffer size to <size> bytes.
  1382.     C    |                | Clear review buffer.
  1383.   S,D,I  |                | Select, Deselect, Invert all lines.
  1384.   S,D,I  | S              |    "       "        "    Search line only.
  1385.   S,D,I  | T              |    "       "        "    from search line to top.
  1386.   S.D.I  | B              |    "       "        "    from search line to bottom.
  1387.     J    | <lines>        | Jump relative to search line by <lines> lines.
  1388.          |                |   Negative numbers search towards top.
  1389.     K    | <line>         | Jump relative to <line> from top.
  1390.          |                |   0 is top line. Negative numbers count from bottom:
  1391.          |                |   -1 is bottom line.
  1392.     F    | <string>       | Search from top Forward for <string>.
  1393.     R    | <string>       | Search from bottom in Reverse for <string>.
  1394.     G    |                | Repeat search Forward.
  1395.     T    |                | Repeat search Reverse.
  1396.     H    | <string>       | Search from last search position Forward for <string>.
  1397.     Y    | <string>       | Search from last search position Reverse for <string>.
  1398.     L    | <name>         | Set environemnt variable <name> to the line of
  1399.          |                |   text at the current horizontal location of the
  1400.          |                |   cursor. See also the "Extract" command.
  1401.     M    | UL  UP  T      | Move Up    Line, Up    Page, to       Top.
  1402.          | DL  DP  B      |  "   Down  Line, Down  Page, to       Bottom.
  1403.          | LC  LP  LM     |  "   Left  Char, Left  Page, to Left  Margin.
  1404.          | RC  RP  RM     |  "   Right Char, Right Page, to Right Margin.
  1405.     O    |                | Open window.
  1406.     P    |                | Scroll page (saves what is currently on screen).
  1407.     Q    |                | Close window.
  1408.     U    |                | Update window.
  1409.     X    | <name>         | If previous command successful, set environment
  1410.          |                |   variable <name> to current search line. Else
  1411.          |                |   erase the environment variable <name>. From an
  1412.          |                |   ARexx context, the Extract command is probably
  1413.          |                |   preferable.
  1414.     W    |                | Resave to current file (overwrites existing file).
  1415.     Z    |                | Save currently selected lines to the Amiga 
  1416.          |                |   Clipboard.
  1417.  
  1418.     To play around with these commands, switch on VLT's console window
  1419.     and type such things as:  ~rev "S" , ~rev "R some_string" , ~rev "M UP"
  1420.  
  1421.  
  1422. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1423.         Appendix C: The trap command
  1424. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1425.  
  1426.     What follows is a syntax diagram of the "trap" command.
  1427. It is discussed in further detail below.
  1428.  
  1429.  
  1430. TRAP <trap-operation>
  1431.     <trap-operation> :=
  1432.        {  add        [ <trap-ID>] [<options>] [<match-string>] [<actions>]
  1433.         | cause        <trap-ID> [<trap-ID> ...]
  1434.         | activate   { <trap-ID> [<trap-ID> ...] | all }
  1435.         | deactivate { <trap-ID> [<trap-ID> ...] | all }
  1436.         | remove     { <trap-ID> [<trap-ID> ...] | all }  }
  1437.  
  1438.     <trap-ID> := 0 < integer number < 32767
  1439.  
  1440.     <options> := [case] [wild] [defer] [autodeactivate] [install]
  1441.  
  1442.     <match-string> := { <left-delimiter> <character-string> <right-delimiter>
  1443.                       | nothing }
  1444.  
  1445.     <actions> := <left-delimiter> <VLT-command-line> <right-delimiter>
  1446.  
  1447.     <left-delimiter>  := one of: { < [ ( " '
  1448.  
  1449.     <right-delimiter) := one of: } > ] ) " '
  1450.  
  1451.     <VLT-command-line> := <VLT-script-command> [; <VLT-script-command> [; ...]]
  1452.  
  1453.  
  1454. Comments:
  1455. ---------
  1456.     - trap add:
  1457.          Add a trap to the system. In case "defer" is specified the trap is
  1458.       initialized as "inactive". An ID only has to be given if the trap is
  1459.       to be referenced specifically by a later command (such as activate).
  1460.       All traps must have both a <match-string> string and an <actions>
  1461.           string although the match string may be the keyword "nothing". Such
  1462.           traps can only be sprung using the "trap cause" command.
  1463.          Traps are in effect for the duration of the context unless they
  1464.       are specifically removed using the "trap remove" command. Traps
  1465.       can be kept active beyond the duration of the context by specifying
  1466.       the "install" option. Before adding the trap, ARP style escapes are
  1467.       interpreted, and if the "case" option is not specified, the match
  1468.       string is converted to upper case.
  1469.          After the trap is added, and if the trap is active, VLT looks for
  1470.       the specified match string from the host and if found it schedules
  1471.       the actions specified in <actions>. If "case" was specified, the
  1472.       search will be case sensitive.
  1473.  
  1474.     - <options>:
  1475.          case:           Makes matching case sensitive.
  1476.          wild:           Allows matching with wildcards (not yet supported).
  1477.          defer:          The trap will be initialized as "not active"
  1478.          autodeactivate: Deactivate trap after first occurrence
  1479.          install:        Install this trap permanently
  1480.  
  1481.     - <actions>:
  1482.          A set of VLT script commands separated with semicolons.
  1483.  
  1484.     - trap cause:
  1485.          Causes trap(s) with specified ID(s) to be sprung.
  1486.  
  1487.     - trap activate:
  1488.          Causes trap(s) with specified ID(s) to be activated.
  1489.  
  1490.     - trap deactivate:
  1491.          Causes trap(s) with specified ID(s) to be deactivated.
  1492.  
  1493.     - trap remove:
  1494.          Removes trap(s) with specified ID(s) from the trap list.
  1495.     
  1496. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1497.         Appendix D: Example of the use of the WEDGE command
  1498. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1499. /**
  1500. *
  1501. *   Example program to intercept keystrokes.
  1502. *
  1503. **/
  1504.  
  1505. /*
  1506. *   Open a port
  1507. */
  1508. mp = openport(FOOBAR)
  1509. /*
  1510. *   Tell VLT to send us stuff
  1511. */
  1512. address VLT "wedge keystrokes FOOBAR"
  1513. /*
  1514. *   Loop until quitflag is 1, waiting for packets
  1515. */
  1516. do forever
  1517.    if quitflag = 1 then leave
  1518.    t = waitpkt(FOOBAR)
  1519. /*
  1520. *   We got a number of packets. Loop over all of them, sifting out "null"s
  1521. */
  1522.    do ff = 1
  1523.       p = getpkt(FOOBAR)
  1524.       if c2d(p) = 0 then leave ff
  1525.       line = getarg(p)
  1526. /*
  1527. *   Got a line. It is of the form: KEYSTROKE character code qualifier,
  1528. *   parse it out.
  1529. */
  1530.       parse var line command code qual char .
  1531. /*
  1532. *   If we got an "a", quit. If a "b", say that we'll handle this one
  1533. *   ourselves by replying a 0 error return and replace it with a capital C!
  1534. *   Notice that we *must* reply first!
  1535. *   Otherwise return a 1.
  1536. */
  1537.       if char = 'a' then quitflag = 1
  1538.       if char = 'b' then do
  1539.          t = reply(p, 0)
  1540.          if (char = 'b') then address VLT "send (C); emit (C);"
  1541.       end
  1542.       else t = reply(p, 1)
  1543.    end
  1544. end
  1545.  
  1546.  
  1547.